#!/bin/bash
echo "[INFO] $(date +%Y-%m-%d_%H:%M%S) Begin analysis" >> /root/analysis.log
source /etc/profile
dateStr=`date "+%Y%m%d"`
hive -e "use default; insert into table user_info select count(distinct id) as active_num, $dateStr from user_clicks where dt=$dateStr"
echo "[INFO] $(date +%Y-%m-%d_%H:%M%S) End analysis" >> /root/analysis.log